|
|
|
|
|
|
|
There is one other way of dealing with resolution changes. That is to create different versions of each form and have the application use the correct set of forms for the resolution that is being used. If you use this method, you should realize that you will be multiplying your effort by the number of screen sizes you want to support. |
|
|
|
|
|
|
|
|
Another thing that Visual Basic does for you is position your form at runtime based on its location at design time. If you are using the 1024×768 resolution at design time and you place a form in the lower-right corner of the screen, it probably will not be seen when the application is run at a lower resolution. You can avoid this by positioning your form in the Form Load event. The following code will always position the form in the top-left corner of the screen: |
|
|
|
|
|
|
|
|
Private Sub Form_Load()
Me.Move 0, 0
End Sub |
|
|
|
|
|
|
|
|
The Move method has the same effect as setting both the Left and Top properties of the form to zero, but the Move method does this in one statement. |
|
|
|
|
|
|
|
|
When designing your application, you must also consider the color display capabilities of the computers on which it might run. Some computers can display 256 or more colors, others are limited to 16. If you design a form that uses the 256-color palette and it is displayed on a computer that is limited to 16 colors, it will process the colors of your form by dithering the colors to simulate the ones that are not available. This will probably cause some of the controls on the form to disappear or look very strange when displayed. |
|
|
|
|
|
|
|
|
To prevent this from happening, sticking with the 16 standard Windows colors is a good idea when you are creating the forms for your application. These colors are represented by the Visual Basic color constants (vbBlack, vbBlue, vbCyan, and so on). If it's necessary to use more than 16 colors in your application, you should still stick with the standard colors for text, buttons, and other interface elements. |
|
|
|
|
|
|
|
|
Tip If you must use the 256-color palette, you should use the standard colors for any text, buttons, or other important interface objects. This way the user will be guaranteed to see them no matter what colors the computer can display. |
|
|
|
|
|
|
|
|
|
Using the Form Editor Features |
|
|
|
|
|
|
|
|
When designing your forms, several features are available to you from the Visual Basic form editor. These functions are listed in the Format menu and in the Form Editor toolbar. Both of these are shown in Figure 7.9. |
|
|
|
|
|